package cn.green.core.components.filter.impl;

import cn.green.core.components.filter.DataFilter;
import cn.green.core.model.QCondition;
import com.alibaba.fastjson.JSONObject;

import java.util.List;

/**
 * @author wang.yishu
 * @version 1.0
 * @className DataFilterImpl
 * @description 数据过滤器
 * @date 2025/3/21 15:54
 */
public class DataFilterImpl implements DataFilter {
    @Override
    public boolean pass(JSONObject record, List<QCondition> qConditions) {
//        boolean result = true;
//        List<Condition> conditions = this.conditionFields(table.getFields(), param);
//        if (conditions != null && !conditions.isEmpty()) {
//            for (Condition condition : conditions) {
//                Object vvl = item.get(condition.getFieldName());
//                if (!condition.isCanGenerateSql()) {
//                    ConditionType type = condition.getType();
//                    List<Object> values = condition.getValues();
//                    if (values == null || values.isEmpty()) {
//                        continue;
//                    }
//                    switch (type) {
//                        case EQ:
//                            Object vbj = values.get(0);
//                            result = result && vvl != null && vvl.equals(vbj);
//                            break;
//                        case RANGE:
//                            Object vbjLeft = values.get(0);
//                            result = result && vvl != null && compareBetween(vbjLeft, vvl) >= 0;
//                            if (values.size() > 1) {
//                                Object vbjRight = values.get(1);
//                                result = result && compareBetween(vvl, vbjRight) >= 0;
//                            }
//                            break;
//                        case LIKE:
//                            Object vStr = values.get(0);
//                            result = result && vvl != null && compareBetween(vStr, vvl) == 0;
//                            break;
//                        default:break;
//                    }
//                }
//            }
//        }
//        return result;
        return false;
    }
}
